package com.ctshk.rpc.order.localfun.service;

import com.ctshk.common.dto.Result;
import com.ctshk.common.model.PageResponse;
import com.ctshk.common.model.TokenUser;
import com.ctshk.rpc.booking.req.system.SystemConfirmReq;
import com.ctshk.rpc.localfun.req.LocalFunProductOrderReq;
import com.ctshk.rpc.order.localfun.dto.*;
import com.ctshk.rpc.order.localfun.req.*;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 景点门票订单 服务类
 * </p>
 *
 * @author 张志朋
 * @since 2021-02-24
 */
public interface ILocalFunOrderService {

    /**
     * 填写订单页新增订单与游客信息
     *
     * @param scenicAddCheckOrderReq 填写订单页新增订单与游客信息入参
     * @return 返回值
     */
    Result addOrderInfo(LocalFunAddCheckOrderReq scenicAddCheckOrderReq, TokenUser userId);

    /**
     * 新增外挂单
     *
     * @param scenicManualOrderReq 新增外挂单入参
     * @param id 用户id
     * @return 返回值
     */
    Result addManualOrder(LocalFunManualOrderReq scenicManualOrderReq, Long id);

    /**
     * 积分兑换港币
     *
     * @param integral 积分
     * @return 返回值
     */
    Result<LocalFunOrderIntegralExchangeDTO> conversionIntegral(Long integral);

    /**
     * 根据订单id查询订单信息
     *
     * @param orderId 订单id
     * @return 订单消息
     */
    Result<LocalFunOrderPayQueryInfoDTO> queryOrderInfo(Long orderId);

    /**
     * 预订中心下单
     *
     * @param payOrderReq 预订中心订单入参
     * @return 返回值
     */
    Result payOrder(PayOrderReq payOrderReq, TokenUser userId);

    PageResponse<LocalFunOrderDTO> list(LocalFunOrderReq scenicOrderReq, TokenUser tokenUser);

    Result<LocalFunOrderDetailDTO>  localFunOrderDetail(LocalFunOrderDetailReq scenicOrderDetailReq);

    /**
     * 收款
     * @param scenic0rderCollectionDetailReq
     * @return
     */
    Result localFunOrderCollection(LocalFunOrderCollectionDetailReq scenic0rderCollectionDetailReq, TokenUser user);

    /**
     * 待付款状态取消订单
     * @param
     * @return
     */
    Result<Long> cancelLocalFunOrder(LocalFun0rderCancelReq scenic0rderCancelReq, TokenUser tokenUser);

    /**
     * 待确认、确认成功、确认取消状态取消订单
     * @param
     * @return
     */
    Result<Long> cancelLocalFunOrderRefund(LocalFunOrderRefundDetailReq scenic0rderRefundDetailReq, TokenUser tokenUser);

    /**
     * 确认订单
     * @param
     * @return
     */
    Result<Long> confirmOrder(LocalFunProductOrderReq scenicProductOrderReq, TokenUser tokenUser);

    /**
     * 通知旅客
     * @param
     * @return
     */
    Result notice(LocalFunOrderNoticeReq scenic0rderNoticeReq);


    /**
     * 供应商预订：预订成功/预订取消操作调用接口
     * @param orderId
     * @param reservationStatus 预订状态  2 预订成功,3 预订取消
     * @return
     */
    Result<Integer> updateOrderConfirmStatus(Long orderId,Integer reservationStatus);


    /**
     * 订单超时 订单状态修改为取消状态
     * @param orderId
     * @return
     */
    Result<Long> updateOrderPaymentStatus(Long orderId);
    /**
     * 動態套票下訂單
     * @param req
     * @return
     */
    Result<Long> payOrder(LocalFunDyTicketPayOrderReq req);


    /**
     * 固定套票下訂單
     * @param req
     * @return
     */
    Result<Long> payFixOrder(LocalFunFixTicketPayOrderReq req);

    /**
     * 查询挂账额度
     * @param req
     * @return
     */
    Result<QueryQuotaDTO> queryQuota(QueryQuotaReq req);

    /**
     * 退款审批通过后，操作
     * @param localFun0rderRefundDetailReq
     * @param currentUser
     * @return
     */
    Result<Long> refundOperate(LocalFunOrderCheckReq localFun0rderRefundDetailReq, TokenUser currentUser);

    /**
     * 供應商預定確認接口
     * @param systemConfirmReq
     * @param userId
     * @return
     */
    Result supplierConfirmOrder(SystemConfirmReq systemConfirmReq, Long userId);

    /**
     * 获取订单金额
     * @param localFunOrderCheckReq
     * @param currentUser
     * @return
     */
    Result<BigDecimal> getOrderAmount(LocalFunProductOrderReq localFunOrderCheckReq, TokenUser currentUser);

    /**
     * 最近一次查询结束时间到当前时间的数据
     * @return
     */
    Result<List<MyLocalFunOrderDTO>> recentToNow(LocalDateTime recent, LocalDateTime now);

    /**
     * 最近一次查询结束时间到当前时间的订单DTO
     */
    List<AddIntegralLocalFunOrderDTO> queryOrderDTOList(LocalDateTime start, LocalDateTime end);

    /**
     * 获取退款时金额
     * @param localFunOrderCheckReq
     * @param currentUser
     * @return
     */
    Result<BigDecimal> getRefundAmount(LocalFunProductOrderReq localFunOrderCheckReq, TokenUser currentUser);
}
















